﻿using CkSoftware.GroupMe.Sdk.Core.Dao;
using Newtonsoft.Json;

namespace CkSoftware.GroupMe.Sdk.Bot.Dao
{
	/// <summary>
	/// The BotData DAO returned by various bot-API requests (index, create).
	/// </summary>
	public class BotData
	{
		/// <summary>
		/// The bot avatar picture as <see cref="PictureData" /> reference.
		/// </summary>
		[JsonIgnore]
		public PictureData AvatarPicture
		{
			get { return new PictureData {Url = AvatarUrl}; }
		}

		/// <summary>
		/// The plain avatar url property given by the API.
		/// </summary>
		[JsonProperty(PropertyName = "avatar_url")]
		public string AvatarUrl { get; set; }

		/// <summary>
		/// The registered callback URL.
		/// </summary>
		[JsonProperty(PropertyName = "callback_url")]
		public string CallbackUrl { get; set; }

		/// <summary>
		/// The group id where the bot is living.
		/// </summary>
		[JsonProperty(PropertyName = "group_id")]
		public string GroupId { get; set; }

		/// <summary>
		/// The group name where the bot is living (undocumented by GroupMe).
		/// </summary>
		[JsonProperty(PropertyName = "group_name")]
		public string GroupName { get; set; }

		/// <summary>
		/// The id of the bot.
		/// </summary>
		[JsonProperty(PropertyName = "bot_id")]
		public string Id { get; set; }

		/// <summary>
		/// The display-name of the bot.
		/// </summary>
		[JsonProperty(PropertyName = "name")]
		public string Name { get; set; }
	}
}